<?php

namespace App\Providers;

use App\Models\Member;
use App\Notifications\Overwrite\DatabaseChannel;
use Illuminate\Database\Eloquent\Relations\Relation;
use Illuminate\Notifications\ChannelManager;
use Illuminate\Support\Facades\Notification;
use Illuminate\Support\ServiceProvider;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        Relation::morphMap([
            'member' => Member::class
        ]);

        Notification::resolved(function (ChannelManager $service) {
            $service->extend('database', function () {
                return new DatabaseChannel();
            });
        });
    }

    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
    }
}
